home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14018 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1017 b 

  1. Path: news.cs.ucla.edu!not-for-mail
  2. From: jlz@pelican.cs.ucla.edu (Jian Zhen)
  3. Newsgroups: comp.lang.c
  4. Subject: help with a simple c routine
  5. Followup-To: poster
  6. Date: 11 Apr 1996 03:34:10 -0700
  7. Organization: UCLA CS Dept
  8. Message-ID: <4kin72$ns5@pelican.cs.ucla.edu>
  9. NNTP-Posting-Host: pelican.cs.ucla.edu
  10.  
  11. Hi all
  12.  
  13. I am trying to write a simple c routine that gets rid of all the .. or . 
  14. in dir paths like somehting/../..  or somedir/./something type
  15.  
  16. so let's say I ahve the follwoing paths
  17.  
  18. /home/jlz/../jlz
  19.  
  20. after parsing it I should have
  21.  
  22. /home/jlz
  23.  
  24. or
  25.  
  26. /home/./jlz
  27.  
  28. it becomes
  29.  
  30. /home/jlz
  31.  
  32. I can't think of an easy way of doing this.  Please help!
  33.  
  34. thanks very much
  35.  
  36. email me if possible.
  37.  
  38. Jian
  39.  
  40.  
  41.  
  42. -- 
  43. +---------------------------------------------------------------------------+
  44. | Jian Liang Zhen | Home         : 1.310.915.5135 | 3325 S. Sepulveda BLVD. |
  45. | jlz@cs.ucla.edu | Lab (BH 3811): 1.310.825.0360 | Apt 6.  LA. CA. 90034   |
  46. |___________/---------- http://pack.cs.ucla.edu:2909/ ----------\___________|
  47.